﻿using System;

namespace Templay.Attributes
{
    [AttributeUsage(AttributeTargets.Property, AllowMultiple = false)]
    public sealed class ProcessAttribute : Attribute
    {

        internal IPropertyProcessProvider provider;

        public ProcessAttribute(Type providerType)
        {
            if (providerType.GetInterface("IPropertyProcessProvider") == null)
                throw new Exception("the type in the process attribute is not a IPropertyProcessProvider");

            this.provider = Activator.CreateInstance(providerType) as IPropertyProcessProvider;
        }

    }
}
